[문자열 덧셈 계산기] 이수혁 미션 제출합니다.#1114
Open
leestana01 wants to merge 8 commits intowoowacourse-precourse:mainfrom
Open
[문자열 덧셈 계산기] 이수혁 미션 제출합니다.#1114leestana01 wants to merge 8 commits intowoowacourse-precourse:mainfrom
leestana01 wants to merge 8 commits intowoowacourse-precourse:mainfrom
Conversation
빈 문자열 입력 시 0을 반환하는 기능 구현 - StringCalculator 클래스 생성 - calculate 메서드에서 빈 문자열 또는 null 체크 후 0 반환 - 빈 문자열 입력 테스트 작성 및 통과
숫자 하나 입력 시 해당 숫자를 반환하는 기능 구현 - calculate 메서드에서 Integer.parseInt로 문자열을 정수로 변환 - 단일 숫자 입력 테스트 작성 및 통과
쉼표 구분자로 두 숫자 입력 시 합을 반환하는 기능 구현 - split 메서드로 쉼표 기준 문자열 분리 - sum 메서드 추가하여 배열의 모든 숫자 합산 - 쉼표 구분자 입력 테스트 작성 및 통과
쉼표 또는 콜론 구분자로 여러 숫자 입력 시 합을 반환하는 기능 구현 - split 메서드에 정규표현식 [,:]을 사용하여 쉼표와 콜론 동시 지원 - 여러 숫자를 쉼표, 콜론, 혼합 구분자로 입력하는 테스트 작성 및 통과
커스텀 구분자 지정 기능 구현 - //구분자\n 형식으로 커스텀 구분자 지정 - 문자열 시작이 //인 경우 \n 까지의 문자를 커스텀 구분자로 추출 - escapeRegex 메서드로 정규표현식 특수문자 이스케이프 처리 - 커스텀 구분자 테스트 작성 및 통과
음수 입력 시 예외 발생 기능 구현 - sum 메서드에서 숫자가 음수인 경우 IllegalArgumentException 발생 - 음수 입력 테스트 작성 및 통과
사용자 입력 및 결과 출력 기능 구현
- Console.readLine()으로 사용자 입력 받기
- 계산 결과를 "결과 : {result}" 형식으로 출력
- 리터럴 백슬래시n(\n) 처리 로직 추가
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 작업 내역
'문자열 덧셈 계산기' 1주차 미션 요구사항에 맞춰 전체 기능을 구현했습니다.
구현한 기능 목록